package com.red.star.wechat.data.mappers;

import com.red.star.wechat.data.core.base.MyMapper;
import com.red.star.wechat.data.entity.StatAskanswer;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author tx_li
 * @date 2018/7/25.
 * 首页问答统计访问接口
 */
public interface StatAskanswerMapper extends MyMapper<StatAskanswer> {

    int isShare(int fansId);

    @Select("SELECT id ,fans_id,from_id,enum_opt_type, MAX(create_time) create_time,update_time  FROM stat_askanswer where fans_id=#{fansId} and from_id is not null  GROUP BY from_id")
    List<StatAskanswer> selectByFansId(int fansId);

    @Select("SELECT id ,fans_id,ip,city,from_id,enum_opt_type, MAX(create_time) create_time,update_time  FROM stat_askanswer where fans_id=#{fansId} and from_id is not null  GROUP BY from_id")
    List<StatAskanswer> selectStatAnswerByFansId(int fansId);

    List<StatAskanswer> findStatAskAnswerList(StatAskanswer statAskAnswer);

}
